package com.tx.activemq._02_broker;

import org.apache.activemq.broker.BrokerService;

/**
 * 嵌入式broker实现
 */
public class EmbedBroker {
    public static void main(String[] args) throws Exception {
        //broker服务
        BrokerService brokerService = new BrokerService();

        //把小型mq服务器嵌入到java代码中
        brokerService.setUseJmx(true);

        //设置mq的地址，注意这里不再是linux mq的地址了
        brokerService.addConnector("tcp://localhost:61616");

        //启动
        brokerService.start();
    }
}